///**
//* Copyright (C) 2018-2021
//* All rights reserved, Designed By www.yixiang.co
//* 注意：
//* 本软件为www.yixiang.co开发研制，未经购买不得使用
//* 购买后可获得全部源代码（禁止转卖、分享、上传到码云、github等开源平台）
//* 一经发现盗用、分享等行为，将追究法律责任，后果自负
//*/
//package co.yixiang.tools.rest;
//import java.util.Arrays;
//import co.yixiang.dozer.service.IGenerator;
//import co.yixiang.tools.service.dto.AliOSSQueryCriteria;
//import lombok.AllArgsConstructor;
//import co.yixiang.logging.aop.log.Log;
//import co.yixiang.tools.domain.AliossConfig;
//import co.yixiang.tools.service.AliossConfigService;
//import co.yixiang.tools.service.dto.AliossConfigQueryCriteria;
//import co.yixiang.tools.service.dto.AliossConfigDto;
//import org.springframework.data.domain.Pageable;
//import org.springframework.http.HttpStatus;
//import org.springframework.http.ResponseEntity;
//import org.springframework.security.access.prepost.PreAuthorize;
//import org.springframework.validation.annotation.Validated;
//import org.springframework.web.bind.annotation.*;
//import io.swagger.annotations.*;
//import java.io.IOException;
//import javax.servlet.http.HttpServletResponse;
//import co.yixiang.domain.PageResult;
///**
//* @author cy
//* @date 2021-06-15
//*/
//@AllArgsConstructor
//@Api(tags = "阿里云配置管理")
//@RestController
//@RequestMapping("/api/aliossConfig")
//public class AliossConfigController {
//
//    private final AliossConfigService aliossConfigService;
//    private final IGenerator generator;
//
//
//    @Log("导出数据")
//    @ApiOperation("导出数据")
//    @GetMapping(value = "/download")
//    @PreAuthorize("@el.check('admin','aliossConfig:list')")
//    public void download(HttpServletResponse response, AliOSSQueryCriteria criteria) throws IOException {
//        aliossConfigService.download(generator.convert(aliossConfigService.queryAll(criteria), AliossConfigDto.class), response);
//    }
//
//    @GetMapping
//    @Log("查询阿里云配置")
//    @ApiOperation("查询阿里云配置")
//    @PreAuthorize("@el.check('admin','aliossConfig:list')")
//    public ResponseEntity<PageResult<AliossConfigDto>> getAliossConfigs(AliOSSQueryCriteria criteria, Pageable pageable){
//        return new ResponseEntity<>(aliossConfigService.queryAll(criteria,pageable),HttpStatus.OK);
//    }
//
//    @PostMapping
//    @Log("新增阿里云配置")
//    @ApiOperation("新增阿里云配置")
//    @PreAuthorize("@el.check('admin','aliossConfig:add')")
//    public ResponseEntity<Object> create(@Validated @RequestBody AliossConfig resources){
//        return new ResponseEntity<>(aliossConfigService.save(resources),HttpStatus.CREATED);
//    }
//
//    @PutMapping
//    @Log("修改阿里云配置")
//    @ApiOperation("修改阿里云配置")
//    @PreAuthorize("@el.check('admin','aliossConfig:edit')")
//    public ResponseEntity<Object> update(@Validated @RequestBody AliossConfig resources){
//        aliossConfigService.updateById(resources);
//        return new ResponseEntity<>(HttpStatus.NO_CONTENT);
//    }
//
//    @Log("删除阿里云配置")
//    @ApiOperation("删除阿里云配置")
//    @PreAuthorize("@el.check('admin','aliossConfig:del')")
//    @DeleteMapping
//    public ResponseEntity<Object> deleteAll(@RequestBody Long[] ids) {
//        Arrays.asList(ids).forEach(id->{
//            aliossConfigService.removeById(id);
//        });
//        return new ResponseEntity<>(HttpStatus.OK);
//    }
//}
